package com.smile.service.impl;

import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.bean.BeanUtil;
import com.smile.api.ShoppingApi;
import com.smile.model.dto.request.AddShoppingRequestDTO;
import com.smile.model.request.AddShoppingRequest;
import com.smile.service.ShoppingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShoppingServiceImpl implements ShoppingService {

    @Autowired
    private ShoppingApi shoppingApi;

    @Override
    @SaIgnore
    public Boolean addShopping(AddShoppingRequestDTO addShoppingRequestDTO) {
        AddShoppingRequest addShoppingRequest = new AddShoppingRequest();
        BeanUtil.copyProperties(addShoppingRequestDTO, addShoppingRequest);
        addShoppingRequest.setUserId(1L);
        addShoppingRequest.setStatus(3);
        shoppingApi.addShopping(addShoppingRequest);
        return Boolean.TRUE;
    }
}
